package com.mk.settlement.model;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.mk.settlement.common.Util;
import com.mk.settlement.enums.FeeTypeEnums;
import com.mk.settlement.enums.SaleTypeEnums;
import com.mk.settlement.enums.SettlementCategoryEnums;
import com.mk.settlement.enums.SettlementStatusEnums;
import com.mk.settlement.enums.SettlementTypeEnums;

public class SettlementResult {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.id
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_target_id
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Long settlementTargetId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_target_name
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private String settlementTargetName;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_begin_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    @DateTimeFormat(pattern="yyyy-MM-dd 00:00:00")
    private Date settlementBeginTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_end_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    @DateTimeFormat(pattern="yyyy-MM-dd 00:00:00")
    private Date settlementEndTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.fee_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Integer feeType;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_total_sum
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private BigDecimal settlementTotalSum;
    
    
    private BigDecimal settlementSaleSum;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_status
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Integer settlementStatus;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Integer settlementType;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.settlement_category
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Integer settlementCategory;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.sale_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    private Integer saleType;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.create_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column settlement_result.update_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    
    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
    
    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.id
     *
     * @return the value of settlement_result.id
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.id
     *
     * @param id the value for settlement_result.id
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_target_id
     *
     * @return the value of settlement_result.settlement_target_id
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Long getSettlementTargetId() {
        return settlementTargetId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_target_id
     *
     * @param settlementTargetId the value for settlement_result.settlement_target_id
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementTargetId(Long settlementTargetId) {
        this.settlementTargetId = settlementTargetId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_target_name
     *
     * @return the value of settlement_result.settlement_target_name
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public String getSettlementTargetName() {
        return settlementTargetName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_target_name
     *
     * @param settlementTargetName the value for settlement_result.settlement_target_name
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementTargetName(String settlementTargetName) {
        this.settlementTargetName = settlementTargetName == null ? null : settlementTargetName.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_begin_time
     *
     * @return the value of settlement_result.settlement_begin_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Date getSettlementBeginTime() {
        return settlementBeginTime;
    }

    
    public String getStrSettlementBeginTime() {
    	if (settlementBeginTime == null) {
            return null;
        }
        return Util.dateToStr(settlementBeginTime);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_begin_time
     *
     * @param settlementBeginTime the value for settlement_result.settlement_begin_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementBeginTime(Date settlementBeginTime) {
        this.settlementBeginTime = settlementBeginTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_end_time
     *
     * @return the value of settlement_result.settlement_end_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Date getSettlementEndTime() {
        return settlementEndTime;
    }
    
    public String getStrSettlementEndTime() {
    	if (settlementEndTime == null) {
            return null;
        }
        return Util.dateToStr(settlementEndTime);
    }
    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_end_time
     *
     * @param settlementEndTime the value for settlement_result.settlement_end_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementEndTime(Date settlementEndTime) {
        this.settlementEndTime = settlementEndTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.fee_type
     *
     * @return the value of settlement_result.fee_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Integer getFeeType() {
        return feeType;
    }

    public String getStrFeeType() {
        if (feeType == null) {
            return null;
        }
        return FeeTypeEnums.getDesc(feeType);
    }
    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.fee_type
     *
     * @param feeType the value for settlement_result.fee_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setFeeType(Integer feeType) {
        this.feeType = feeType;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_total_sum
     *
     * @return the value of settlement_result.settlement_total_sum
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public BigDecimal getSettlementTotalSum() {
        return settlementTotalSum;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_total_sum
     *
     * @param settlementTotalSum the value for settlement_result.settlement_total_sum
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementTotalSum(BigDecimal settlementTotalSum) {
        this.settlementTotalSum = settlementTotalSum;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_status
     *
     * @return the value of settlement_result.settlement_status
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Integer getSettlementStatus() {
        return settlementStatus;
    }
    
    public String getStrSettlementStatus() {
        if (settlementStatus == null) {
            return null;
        }
        return SettlementStatusEnums.getDesc(settlementStatus);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_status
     *
     * @param settlementStatus the value for settlement_result.settlement_status
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementStatus(Integer settlementStatus) {
        this.settlementStatus = settlementStatus;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_type
     *
     * @return the value of settlement_result.settlement_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Integer getSettlementType() {
        return settlementType;
    }
    
    public String getStrSettlementType() {
        if (settlementType == null) {
            return null;
        }
        return SettlementTypeEnums.getDesc(settlementType);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_type
     *
     * @param settlementType the value for settlement_result.settlement_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementType(Integer settlementType) {
        this.settlementType = settlementType;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.settlement_category
     *
     * @return the value of settlement_result.settlement_category
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Integer getSettlementCategory() {
        return settlementCategory;
    }

    public String getStrSettlementCategory() {
        if (settlementCategory == null) {
            return null;
        }
        return SettlementCategoryEnums.getDesc(settlementCategory);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.settlement_category
     *
     * @param settlementCategory the value for settlement_result.settlement_category
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSettlementCategory(Integer settlementCategory) {
        this.settlementCategory = settlementCategory;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.sale_type
     *
     * @return the value of settlement_result.sale_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Integer getSaleType() {
        return saleType;
    }
    
    public String getStrSaleType() {
        if (saleType == null) {
            return null;
        }
    	return SaleTypeEnums.getDesc(saleType);
    }
    
    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.sale_type
     *
     * @param saleType the value for settlement_result.sale_type
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setSaleType(Integer saleType) {
        this.saleType = saleType;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.create_time
     *
     * @return the value of settlement_result.create_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Date getCreateTime() {
        return createTime;
    }
    
    public String getStrCreateTime() {
        if (createTime == null) {
            return null;
        }
        return Util.dateToStr(createTime);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.create_time
     *
     * @param createTime the value for settlement_result.create_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column settlement_result.update_time
     *
     * @return the value of settlement_result.update_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column settlement_result.update_time
     *
     * @param updateTime the value for settlement_result.update_time
     *
     * @mbggenerated Thu Dec 24 19:28:15 CST 2015
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    
    public BigDecimal getSettlementSaleSum() {
        return settlementSaleSum;
    }

    public void setSettlementSaleSum(BigDecimal settlementSaleSum) {
        this.settlementSaleSum = settlementSaleSum;
    }

    public String toString() {
        
        return "id:" + id + ",settlementTargetId:" + settlementTargetId + ",feeType:" + feeType +",settlementType:" + settlementType + ",settlementCategory:" + settlementCategory
                + ",saleType:" + saleType + ",settlementBeginTime:" + sdf.format(settlementBeginTime) + ",settlementEndTime:" + sdf.format(settlementEndTime);
    }

}